<?php

include "8_1.php";
include "8_6.php";
include "9_0.php";

function combine($original, $new)
{
	$h = fopen("c:\\temp\\combined.php", "w+");
	
	fwrite($h, "<?php\r\narray(\r\n");
	
	$translated = "\r\n\r\n  /**********************************************************************\r\n";
	$translated.= "  /*                           CONVERTED                                *\r\n";
	$translated.= "  **********************************************************************/\r\n\r\n\r\n";
	$untranslated = "\r\n\r\n  /**********************************************************************\r\n";
	$untranslated.= "  /*                             ORIGINAL                               *\r\n";
	$untranslated.= "  **********************************************************************/\r\n\r\n\r\n";
	
	foreach($new as $k=>$v)
	{
		$suffix = "\r\n  /* Original text: $v */\r\n ";
		if($original[$k] != "" && $original[$k] != $v)
		{		
			
			$translated.= "  '$k' => '".str_replace("'", "\\'", $original[$k])."', //converted". $suffix;
		}else
			$untranslated.= "'$k' => '".str_replace("'", "\\'", $v)."', ".$suffix;
		
	}
	fwrite ($h, $untranslated);
	fwrite ($h, $translated);
	fwrite($h, ");\r\n\r\n?>\r\n");
	
	fclose($h);
}

combine($lmsg_8_6, $lmsg_9_0);

?>